/* Copyright 2001,2002,2003 NAH6 BV
 * All Rights Reserved
 *
 *  $Header: /var/lib/cvs/secphone/ui/phone/BatteryClass.cpp,v 1.6 2003/11/21 16:12:58 itsme Exp $
 *
 *
 *  used to update battery level indicator.
 *
 *  not sure if the win32 version will actually report the battery level of the laptop.
 *
 */

#include "CPhone.h"
#include "CPhoneDlg.h"

#include "debug.h"
#include "BatteryClass.h"


bool BatteryClass::RequestBatteryLife()
{
#ifdef _WIN32_WCE
    SYSTEM_POWER_STATUS_EX2 stat2;
    if (GetSystemPowerStatusEx2(&stat2, sizeof(stat2), false))
        theApp.m_dlg->SetBatteryLife( stat2.BatteryLifePercent);
#else
    SYSTEM_POWER_STATUS stat;
    if (GetSystemPowerStatus(&stat))
        theApp.m_dlg->SetBatteryLife( stat.BatteryLifePercent); 
#endif
    return true;
}


